package com.kaigejava.kgblog.web;

import com.github.pagehelper.PageInfo;
import com.kaigejava.kgblog.model.auto.TblArchive;
import com.kaigejava.kgblog.service.ITblArchiveService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by kaigejava on 2018/7/26.
 */
@Controller
@RequestMapping(value = "/archive")
public class TblArchiveController {

    @Autowired
    private ITblArchiveService archiveService;

    @ResponseBody
    @GetMapping("/all")
    public Object findAllUser(
            @RequestParam(name = "pageNum", required = false, defaultValue = "1") int pageNum,
            @RequestParam(name = "pageSize", required = false, defaultValue = "10")  int pageSize){
        PageInfo<TblArchive>  pageInfo =  archiveService.findAllArchive(pageNum,pageSize);
        return pageInfo;
    }
}
